package com.ruoyi.dgdData.service.impl;

import java.util.List;
import java.util.concurrent.Future;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.dgdData.domain.plat.DataDgdHj;
import com.ruoyi.dgdData.mapper.DataDgdHjMapper;
import com.ruoyi.dgdData.service.IDataDgdHjService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.AsyncResult;
import org.springframework.stereotype.Service;


/**
 * 单轨吊环境测试数据Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-12-28
 */
@Service
public class DataDgdHjServiceImpl implements IDataDgdHjService
{
    @Autowired(required = false)
    private DataDgdHjMapper dataDgdHjMapper;

    /**
     * 查询单轨吊环境测试数据
     * 
     * @param hjId 单轨吊环境测试数据主键
     * @return 单轨吊环境测试数据
     */
    @Override
    public DataDgdHj selectDataDgdHjByHjId(Long hjId)
    {
        return dataDgdHjMapper.selectDataDgdHjByHjId(hjId);
    }

    /**
     * 根据dataTaskId获取数据
     *
     * @param dataTaskId
     * @return
     */
    @Override
    public Future<List<DataDgdHj>> selectDataDgdHjByDataTaskId(Long dataTaskId) {
        return new AsyncResult<>(dataDgdHjMapper.selectDataDgdHjByDataTaskId(dataTaskId));
    }

    /**
     * 查询单轨吊环境测试数据列表
     * 
     * @param dataDgdHj 单轨吊环境测试数据
     * @return 单轨吊环境测试数据
     */
    @Override
    public List<DataDgdHj> selectDataDgdHjList(DataDgdHj dataDgdHj)
    {
        return dataDgdHjMapper.selectDataDgdHjList(dataDgdHj);
    }

    /**
     * 新增单轨吊环境测试数据
     * 
     * @param dataDgdHj 单轨吊环境测试数据
     * @return 结果
     */
    @Override
    public int insertDataDgdHj(DataDgdHj dataDgdHj)
    {
        dataDgdHj.setCreateTime(DateUtils.getNowDate());
        return dataDgdHjMapper.insertDataDgdHj(dataDgdHj);
    }

    /**
     * 批量新增环境测试数据
     *
     * @param dataDgdHjs
     */
    @Override
    public int batchDataDgdHj(List<DataDgdHj> dataDgdHjs) {
        return dataDgdHjMapper.batchDataDgdHj(dataDgdHjs);
    }

    /**
     * 修改单轨吊环境测试数据
     * 
     * @param dataDgdHj 单轨吊环境测试数据
     * @return 结果
     */
    @Override
    public int updateDataDgdHj(DataDgdHj dataDgdHj)
    {
        dataDgdHj.setUpdateTime(DateUtils.getNowDate());
        return dataDgdHjMapper.updateDataDgdHj(dataDgdHj);
    }

    /**
     * 变更单轨吊环境数据状态为2
     *
     * @param hjId 单轨吊环境数据主键
     * @return 结果
     */
    @Override
    public int updateDataDgdHjByHjId(Long hjId) {
        return dataDgdHjMapper.updateDataDgdHjByHjId(hjId);
    }

    /**
     * 变更单轨吊环境数据状态为2
     *
     * @param dataTaskId
     * @return 结果
     */
    @Override
    public int updateDataDgdHjByDataTaskId(Long dataTaskId) {
        return dataDgdHjMapper.updateDataDgdHjByDataTaskId(dataTaskId);
    }

    /**
     * 批量删除单轨吊环境测试数据
     * 
     * @param hjIds 需要删除的单轨吊环境测试数据主键
     * @return 结果
     */
    @Override
    public int deleteDataDgdHjByHjIds(Long[] hjIds)
    {
        return dataDgdHjMapper.deleteDataDgdHjByHjIds(hjIds);
    }

    /**
     * 删除单轨吊环境测试数据信息
     * 
     * @param hjId 单轨吊环境测试数据主键
     * @return 结果
     */
    @Override
    public int deleteDataDgdHjByHjId(Long hjId)
    {
        return dataDgdHjMapper.deleteDataDgdHjByHjId(hjId);
    }
}
